X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/95d7601b7742ed560a9d8e00269217f62fc7ce32..2af83e98005a14c439b360a5b9ac636f594d9f0c:/Super%20Polarity/SuperPolarity.cs diff --git a/Super Polarity/SuperPolarity.cs b/Super Polarity/SuperPolarity.cs index c43582e..b590079 100644 --- a/Super Polarity/SuperPolarity.cs +++ b/Super Polarity/SuperPolarity.cs @@ -20,18 +20,13 @@ namespace SuperPolarity public static GraphicsDeviceManager graphics; SpriteBatch spriteBatch; - // Input Handler - KeyboardState currentKeyboardState; - GamePadState currentGamePadState; - - MainShip player; - public SuperPolarity() : base() { SuperPolarity.graphics = new GraphicsDeviceManager(this); SuperPolarity.graphics.PreferMultiSampling = true; Content.RootDirectory = "Content"; + ActorFactory.SetGame(this); } /// @@ -42,9 +37,13 @@ namespace SuperPolarity /// protected override void Initialize() { - player = new MainShip(); - base.Initialize(); + + InputController.RegisterEventForButton("changePolarity", Buttons.A); + InputController.RegisterEventForKey("changePolarity", Keys.Z); + + InputController.RegisterEventForButton("shoot", Buttons.X); + InputController.RegisterEventForKey("shoot", Keys.X); } /// @@ -58,7 +57,9 @@ namespace SuperPolarity Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2); - player.Initialize(Content, Content.Load("Graphics\\main-ship"), playerPosition); + ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200)); + ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200)); + ActorFactory.CreateMainShip(playerPosition); } /// @@ -83,7 +84,7 @@ namespace SuperPolarity // TODO: Add your update logic here InputController.UpdateInput(); - player.Update(gameTime); + ActorManager.Update(gameTime); base.Update(gameTime); } @@ -98,7 +99,7 @@ namespace SuperPolarity spriteBatch.Begin(); - player.Draw(spriteBatch); + ActorManager.Draw(spriteBatch); spriteBatch.End();